<template>
  <div class="frame">
    <div class="frame_content">
      <div class="frame_top">
        <img src="../../assets/images/init/编组 17.png" alt="" />
        小漠水库
      </div>
      <div class="frame_middle">
        <div class="frame_middle_video">监控视频</div>
        <div class="frame_middle_info">
          <!-- 详细信息 -->
          <div class="shuichang">
            <div class="datalist">
              <div class="dataheader">
                <div
                  class="headerlist"
                  v-for="(item, index) in datalist.headerData"
                  :key="index"
                >
                  <span>
                    {{ item }}
                  </span>
                </div>
              </div>
              <div class="databoxs">
                <div
                  v-for="(item, index) in datalist.data"
                  :key="index"
                  class="databox"
                >
                  <div class="name">
                    <span>
                      {{ item.name }}
                    </span>
                  </div>
                  <div class="zcxsw">
                    <span>
                      {{ item.zcxsw }}
                    </span>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <div class="frame_bottom">
        <div class="frame_bottom_water_level">
          <div id="tabbox">
            <div class="tab-tit">
              <a
                href="javascript:;"
                @click="msg = 0"
                :class="{ cur: msg === 0 }"
                >水位雨量过程</a
              >
              <a
                href="javascript:;"
                class="yuan"
                @click="msg = 1"
                :class="{ cur: msg === 1 }"
                >预案</a
              >
              <a
                href="javascript:;"
                @click="msg = 2"
                :class="{ cur: msg === 2 }"
                >水循环</a
              >
              <a
                href="javascript:;"
                @click="msg = 3"
                :class="{ cur: msg === 3 }"
                >报表统计</a
              >
            </div>
            <div class="tab-con">
              <div v-show="msg === 0">
                <div class="tubiao">
                  <div
                    id="borderchart"
                    style="width:500px;height:200px; margin-left: 0px"
                  ></div>
                </div>
              </div>
              <div v-show="msg === 1">
                23456
              </div>
              <div v-show="msg === 2">
                0987654
              </div>
              <div v-show="msg === 3">
                5434567y
              </div>
            </div>
          </div>
        </div>
        <div class="frame_bottom_qst">
          趋势图数据
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import * as echarts from "echarts";
export default {
  data() {
    return {
      msg: 0,
      datalist: {
        data: [
          {
            name: "所属镇",
            zcxsw: "南阳镇",
          },
          {
            name: "工程等级",
            zcxsw: "一级",
          },
          {
            name: "建成时间",
            zcxsw: "2000/12/23",
          },
          {
            name: "集雨面积(㎡)",
            zcxsw: "44.50",
          },
          {
            name: "设计洪水位(m)",
            zcxsw: "3.28",
          },
          {
            name: "校核水位(m)",
            zcxsw: "49.06",
          },

          {
            name: "正常蓄水位(m)",
            zcxsw: "37.55",
          },

          {
            name: "防汛水位(m)",
            zcxsw: "152.00",
          },
          {
            name: "死水位(m)",
            zcxsw: "412.94",
          },

          {
            name: "总库容(万m³)",
            zcxsw: "/",
          },

          {
            name: "防汛水位(m)",
            zcxsw: "152.00",
          },
        ],
      },

      option: {
        title: {
          text: "小漠水库水位过线和降雨量",
          textStyle: {
            color: "#5BD9FE",
            fontSize: 15,
          },
        },
        tooltip: {
          trigger: "axis",
          axisPointer: {
            type: "line",
          },
        },
        legend: {
          itemHeight: 10,
          itemWidth: 10,
          icon: "circle", // 修改形状
          itemGap: 15, // 修改间距
          bottom: 10,
          // left:0,
          textStyle: {
            //图例文字的样式
            color: "rgba(255,255,255,0.8)",
            fontSize: 12,
          },
          data: ["汛限水位", "降雨量", "死水位", "当前水位", "校核洪水位"],
        },
        grid: {
          left: "3%",
          right: "4%",
          bottom: "20%",

          containLabel: true,
        },
        xAxis: {
          type: "category",
          axisLabel: {
            textStyle: {
              color: "rgba(255,255,255,0.8)",
            },
          },
          axisTick: {
            //x轴刻度线
            show: false,
          },
          data: ["19日00时", "19日12时"],
        },
        yAxis: [
          {
            name: "水位(m)",
            type: "value",
            max: 400,
            min: 0,
            splitNumber: 5,

            axisLabel: {
              textStyle: {
                color: "rgba(255,255,255,0.8)",
              },
            },

            splitLine: {
              show: true,
              lineStyle: {
                type: "dashed",
                color: "rgba(255,255,255,0.1)",
                // color:rgba(255,255,255,.5)
              },
            },
          },
          {
            name: "降水量(mm)",
            type: "value",
            max: 60,
            min: 0,
            splitNumber: 5,

            axisLabel: {
              textStyle: {
                color: "rgba(255,255,255,0.8)",
              },
            },

            splitLine: {
              show: true,
              lineStyle: {
                type: "dashed",
                color: "rgba(255,255,255,0.1)",
                // color:rgba(255,255,255,.5)
              },
            },
          },
        ],
        series: [
          {
            name: "汛限水位",
            smooth: true,
            yAxisIndex: 0,
            type: "line",
            symbol: "none", //这句就是去掉点的
            data: [52, 52],
          },
          {
            name: "降雨量",
            type: "line",
            yAxisIndex: 0,
            smooth: true,
            symbol: "none", //这句就是去掉点的
            data: [0, 0],
          },
          {
            name: "死水位",
            smooth: true,
            yAxisIndex: 1,
            type: "line",
            symbol: "none", //这句就是去掉点的
            data: [40, 40],
          },
          {
            name: "当前水位",
            smooth: true,
            yAxisIndex: 1,
            type: "line",
            symbol: "none", //这句就是去掉点的
            data: [44, 44],
          },
          {
            name: "校核洪水位",
            smooth: true,
            symbol: "none", //这句就是去掉点的
            yAxisIndex: 1,

            type: "line",
            data: [53, 53],
          },
        ],
      },
    };
  },
  methods: {
    showtchart() {
      let myChart = echarts.init(document.getElementById("borderchart"));
      myChart.setOption(this.option);
    },
  },
  mounted() {
    this.showtchart();
  },
};
</script>

<style lang="scss" scoped>
.frame {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  // z-index: 999;
  position: absolute;
  .frame_content {
    width: 1200px;
    height: 750px;
    border: 1px solid rosybrown;
    display: flex;
    flex-direction: column;
    // background-color: sandybrown;
    .frame_top {
      display: flex;
      align-items: center;

      font-size: 18px;
      margin: 10px 0;
      img {
        width: 12px;
        height: 15px;
        margin-left: 10px;
        margin-right: 20px;
      }
    }
    .frame_middle {
      width: 100%;
      display: flex;
      align-items: center;
      // justify-content: center;
      justify-content: space-around;
      .frame_middle_video {
        width: 801px;
        height: 424px;
        border: 1px solid springgreen;
      }
      .frame_middle_info {
        height: 424px;
        width: 300px;
        border: 1px solid springgreen;
        margin-left: -20px;
        .shuichang {
          width: 300px;
          height: 420px;
          border: 1px solid red;
          .datalist {
            // .dataheader {
            //     width: 100%;
            //     height: 40px;
            //     background: rgba(1, 211, 248, 0.19);
            //     display: flex;
            //     justify-content: space-around;
            //     align-items: center;
            //     font-size: 12px;
            //     color: rgba(255, 255, 255, 0.651);
            //     position: relative;
            //     &::after {
            //         content: '';
            //         position: absolute;
            //         width: 100%;
            //         height: 2px;
            //         bottom: -4px;
            //         background: rgba(1, 211, 248, 0.19);
            //     }
            //     .headerlist {
            //         width: 19.5%;
            //         text-align: center;
            //     }
            // }
            .databoxs {
              // display: flex;
              overflow: auto;
              height: 420px;
              width: 300px;
              margin: 5px 0;
              > .databox:nth-of-type(odd) {
                > div {
                  background: transparent;
                  font-size: 14px;
                }
              }
              > .databox:nth-of-type(even) {
                > div {
                  background: transparent;
                  font-size: 14px;
                }
              }
              .databox {
                width: 285px;
                // text-align: center;
                display: flex;
                justify-content: space-between;
                // align-items: center;

                > div {
                  width: 35.5%;
                  height: 50px;
                  // border: 1px solid red;
                  display: flex;
                  // justify-content: space-evenly;
                  // justify-content: center;
                  // align-items: center;
                  line-height: 50px;
                  background: rgba(17, 38, 80, 0.3);
                  margin: 5px 0px;
                }
                .name span {
                  color: rgba(255, 255, 255, 0.7);
                  font-size: 15px;
                }
                .zcxsw span {
                  // width: -200px;
                  display: flex;
                  justify-content: space-evenly;
                  // justify-content: center;
                  align-items: center;
                  text-align: right;
                  // padding-left: 50px;
                }
              }
            }
          }
        }
      }
    }
    .frame_bottom {
      display: flex;
      justify-content: space-around;
      margin-top: 20px;
      .frame_bottom_water_level {
        width: 532px;
        height: 250px;
        border: 1px solid springgreen;
        margin-left: 3px;
        #tabbox {
          // width: 600px;
          // margin: 0 auto;
          .tab-tit {
            font-size: 16px;
            width: 380px;
            height: 50px;
            // border: 1px solid red;
            display: flex;
            justify-content: space-between;
          }
          .tab-tit a {
            // display: inline-block;
            height: 40px;
            line-height: 40px;
            width: 100px;
            // border: 1px solid red;

            font-size: 15px;
            text-align: center;
            // background: #ccc;
            color: rgba(255, 255, 255, 0.7);
            text-decoration: none;
          }

          .tab-tit .cur {
            cursor: pointer;
            background: url("../../../src/assets/images/home/Rectangle 46.png")
              no-repeat bottom;
            color: #fff;
          }
        }
      }
      .frame_bottom_qst {
        width: 532px;
        height: 250px;
        border: 1px solid springgreen;
        margin-left: -34px;
      }
    }
  }
}
</style>
